package com.hctforgreen.greenservice;

import java.util.ArrayList;

import org.taptwo.android.widget.ViewFlow;
import org.taptwo.android.widget.ViewFlow.ViewSwitchListener;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

import com.hctforgreen.greenservice.model.TipsEntity;
import com.hctforgreen.greenservice.ui.adapter.TipsAdapter;
/**
 * 提示信息页面(第一次启动才显示)
 * @author Tallen Zhai
 *
 */
public class TipsActivity extends ParentActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		super.rightScroll = false;//取消父类的右滑返回动作
		setContentView(R.layout.activity_tips);
		initTitleButtonBar();
		initWindow();
	}
	
	private void initWindow() {
		ViewFlow  viewFlow = (ViewFlow) findViewById(R.id.viewflow);
		final ArrayList<TipsEntity> entities = initEntityLst();
		
		/**
		 * init
		 */
		final TipsAdapter adapter = new TipsAdapter(this, entities);
		int adSize = entities.size();
		viewFlow.setAdapter(adapter, adSize);
		int startIndex = 0;
		viewFlow.setSelection(startIndex);
		
		viewFlow.setOnViewSwitchListener(new ViewSwitchListener() {

			@Override
			public void onSwitched(View view, int position) {
				
			}
		});
	}

	private ArrayList<TipsEntity> initEntityLst() {
		final ArrayList<TipsEntity> entities = new ArrayList<TipsEntity>();
		TipsEntity entity = new TipsEntity();
		
		entity.drawable_id = R.drawable.ic_tips_1;
		entities.add(entity);
		
		entity = new TipsEntity();
		entity.drawable_id = R.drawable.ic_tips_2;
		entities.add(entity);
		
		entity = new TipsEntity();
		entity.drawable_id = R.drawable.ic_tips_3;
		entities.add(entity);
		return entities;
	}
	private void initTitleButtonBar() {
		

	}
}
